#include "bt_serial.h"
#include <string.h>
#include <sys/param.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include <stdio.h>

#define TX_RX_BUF_SIZE   CONFIG_TX_RX_DATA_BUF_SIZE

static void ctr_rx_task(void* pv)
{
    /*receive buf*/
    char buf[TX_RX_BUF_SIZE+1] = {0};
    ssize_t recv_len = 0;
    printf("Start bt ctr_rx_task\n");

    while(1)
    {
        vTaskDelay(1000/portTICK_PERIOD_MS);
    }
}

static void ctr_tx_task(void *pv)
{
    printf("Start bt ctr_tx_task\n");
    while(1)
    {
        vTaskDelay(1000/portTICK_PERIOD_MS);
    }
}


void bt_ctrl_init(void)
{
    if(bt_serial_begin("hqm", false))
    {
        // xTaskCreate(ctr_rx_task, "bt_ctr_rx_task", 4096, NULL, 100, NULL);
        // xTaskCreate(ctr_tx_task, "bt_ctr_tx_task", 4096, NULL, 101, NULL);
    }
    else
    {
        printf("Error bt serial init failure\n");
    }
}